Mathematics · Year 2 11 min read

Real Analysis: Why Calculus Works

Calculus gave right answers for 150 years before anyone could say why. Analysis is the answer: the number line has no gaps, and "gets close" can be made exact.
The Default Library · What Each Major Knows · 72

Your calculator says √2 is 1.41421356... and you trust it, because squaring that gives something extremely close to 2. But "extremely close" is a strange foundation. Newton and Leibniz built calculus on quantities that were "infinitely small but not zero", and a bishop, George Berkeley, mocked them in 1734 as "ghosts of departed quantities". The answers were right. The explanation was missing.

Add a second discomfort. Rearrange the order of an infinite sum and you can change its value. Take a function that is smooth at every step of a construction and the limit can have a jump in it. Draw a curve with no gaps and it can still have no tangent at any point. Each of these was a shock in the nineteenth century, and a course called real analysis is where you learn why they happen and how to stay out of trouble.

A graduate "just sees" that a limit is a promise you can keep for any tolerance, that the real line is solid in a precise sense, and that infinite processes need conditions before you may trust them.

The course in one box
Who takes it
Every mathematics major, in year 2 (MIT's 18.100 family; Cambridge's Analysis I in the first year). Physics and economics majors often take a lighter version. The course is where many students first feel what "proof" means.
What it is for
Proving, from the properties of the real numbers alone, that the calculus you already know is correct, and finding where it breaks.
Comes after
Calculus I (34/01) and Foundations: What Mathematics Stands On (34/71).
Leads to
Complex Analysis (34/74) and Topology (34/76), and it quietly underlies Differential Equations (34/03) and Numerical Analysis (34/78).
What this piece gives you
You will not be able to work through a Rudin chapter. You will know what the ε–δ game is, why the rationals have holes, why some series cannot be reordered, and why a limit of continuous functions need not be continuous. The easier first read is Calculus: The Language of Change (12/11) and the first course of this series, Calculus I (34/01). This one asks why those answers hold.

The real numbers have no gaps

The rational numbers (fractions) are dense: between any two there is another. Yet they have holes. Euclid's argument, recalled in 34/71, shows no fraction squares to 2. Still you can walk towards the hole: 1, 1.4, 1.41, 1.414, ... each of these is a fraction whose square is a little under 2. Each also has a partner one last digit higher whose square is a little over 2. The gap between the pair shrinks by a factor of ten each time, and yet no fraction sits where they close in.

The real numbers fill every such hole. That property is called completeness, and it can be stated in one line:

every set with an upper bound has a least upper bound(the supremum: sup of {x : x² < 2} is √2, which is a real number but not a rational one)

In 1872 Richard Dedekind and Georg Cantor each gave a construction of the reals that makes this true, so the number line is built rather than assumed. The trick of the whole subject is that this one property, plus the ordinary rules of arithmetic, is enough to prove everything in calculus. The rationals satisfy all the same arithmetic and fail only this, which is why calculus fails over the rationals: a continuous function on fractions can go from below zero to above zero without ever being zero.

Interactive · Squeeze the hole
Decimal digits kept

Exact integer arithmetic, no rounding: both ends are fractions with the denominator 10k.

Without JavaScript: 1.414 and 1.415 are fractions with 1.414² = 1.999396 < 2 < 2.002225 = 1.415². Add digits and the pair closes in on √2 = 1.41421356..., which is not a fraction.

Each pair is an interval, each inside the last. The nested interval principle (a consequence of completeness) says that nested closed intervals always share a point. For fractions only, the shared point is missing; for reals, it is there. That is the whole difference.

A limit is a game you always win

Here is the definition that rescued calculus, mostly the work of Cauchy in the 1820s and Weierstrass in the 1860s. To say f(x) tends to L as x approaches a is to say you win this game. An opponent names any tolerance ε > 0 however small. You must answer with a distance δ > 0 so that every x within δ of a (but not equal to a) has f(x) within ε of L. If you can always answer, the limit is L. If the opponent has some ε you cannot answer, the limit is not L.

Order matters here, exactly as in 34/71: for every ε, there is a δ, and the δ may depend on ε. A worked win for f(x) = x² near a = 2 (limit 4): we have |x² − 4| = |x − 2| · |x + 2|. If δ ≤ 1, then x is between 1 and 3, so |x + 2| < 5, and the product is under 5δ. So choose δ = min(1, ε/5). The trick is to bound the awkward factor first, then let the small factor do the work.

Now play it. Choose a function, an opponent's ε, and your δ; the page tests your δ at 20,001 sample points and also hunts for the best δ. Then try the two functions that have no limit, and watch the opponent win however you play.

Interactive · The epsilon–delta game
Opponent's ε
Your δ

Without JavaScript: for x² near 2 with ε = 0.1, δ = min(1, 0.1/5) = 0.02 wins. For the jump function (0 left of 1, 1 from 1 on) no δ wins against ε = 0.5, because there are always points just left of 1 where the value is 0.

Note where the proof lives. You never "go to" a. You answer a question about distances, which are plain numbers, so no ghosts remain.

Infinite sums need rules: the series you can reorder, and the ones you cannot

A series is a sum with infinitely many terms, and it converges if its partial sums settle to a limit. A quick fact: if the terms do not shrink to zero it cannot converge. The converse is false, and the best example is the harmonic series 1 + 1/2 + 1/3 + 1/4 + ... It diverges. Proof sketch, due to Oresme in the 14th century: group the terms 1/3 + 1/4 > 1/2, then 1/5 + ... + 1/8 > 1/2, then the next eight terms, and so on. Every group adds at least 1/2, so you pass any number. The trick is grouping so each batch is compared to a fixed amount.

Flip every other sign and it converges: 1 − 1/2 + 1/3 − 1/4 + ... = ln 2 ≈ 0.6931. Now the shock. Take exactly the same terms, none left out, and reorder them. In the 1850s Bernhard Riemann showed you can make the sum equal any real number you like. The reason: the positive terms alone add up to infinity, and so do the negative ones, while each term shrinks to zero. To aim at a target, add positive terms until you pass it, then negative terms until you drop below, and repeat. The overshoots get smaller because the terms do.

Series that stay safe when reordered are the absolutely convergent ones, whose absolute values also sum finitely. That is the condition behind a lot of fine print in later courses.

Interactive · Make the series equal what you want
Target sum
Terms used

Without JavaScript: in the usual order, the partial sums of 1 − 1/2 + 1/3 − ... head to 0.6931. Reordered greedily (add odd-denominator positives while below the target, even-denominator negatives while above), the same terms head to 2, or to any target you choose.

Continuous functions cannot skip a value

Completeness delivers the theorem behind every "there must be a point where..." in applied mathematics: the intermediate value theorem. If a continuous function is negative at one end of an interval and positive at the other, it is zero somewhere in between. Proof sketch: take the supremum of the points where the function is still negative. By continuity it cannot be negative or positive there, so it is zero. The trick is that the supremum exists, which is exactly where the gap-free real line is used. Over the rationals the sup of {x : x² < 2} does not exist, and the theorem fails.

The proof is also an algorithm. Check the midpoint, keep the half where the sign changes, repeat. This is bisection. Every step halves the interval, so after 10 steps the root is trapped in a window 1/1,024 of the original, and after 50 steps in a window around 10-15 of it. The guarantee is mathematics, but the computer is not mathematics: floating-point numbers have only about 16 significant digits, so the halving must stall. Watch it happen.

Interactive · Bisection until the numbers run out
Bisection steps

Without JavaScript: bisection on x² − 2 over [1, 2] traps √2 in an interval of width 2-10 ≈ 0.001 after 10 steps. In double precision the width stops shrinking near 2-52 ≈ 2.2 × 10-16.

This is the first brush with Numerical Analysis (34/78): a theorem tells you the answer exists, and arithmetic tells you how close you can get.

A limit of nice functions can be rude

Take fn(x) = xn on [0, 1]. Every one is continuous and smooth. As n grows, each fixed x below 1 gets xn → 0, while at x = 1 the value stays 1. The limit function jumps. A limit of continuous functions need not be continuous, if the convergence is only pointwise.

The fix is a stronger notion, uniform convergence: one ε works for all x at once, so the whole graph squeezes into a thin band round the limit. For xn on [0, 0.9] that happens, since 0.9n → 0. On [0, 1) it never does: for any n you can find an x close enough to 1 that xn is as big as 0.99. The trick of the proof is to compare the worst point, not each point. The theorem to remember: a uniform limit of continuous functions is continuous. This is what lets you differentiate a power series term by term.

Interactive · Pointwise is not uniform
Power n in xn
Inspect the region [0, r]

Without JavaScript: for n = 20, 0.920 ≈ 0.12 and 0.9920 ≈ 0.82, while the limit function is 0 there. On [0, 0.9] the worst gap shrinks to nothing as n grows; on [0, 1) it stays near 1.

A curve with no tangent anywhere

Until the 1870s mathematicians assumed a continuous curve had a tangent at most points, because anything you could draw did. In 1872 Karl Weierstrass presented a counter-example, now called the Weierstrass function:

W(x) = Σ ak cos(bk π x)0 < a < 1, b an odd integer, ab > 1 + 3π/2 (Hardy 1916 showed ab ≥ 1 is enough)

It is a sum of waves, each narrower and smaller than the last. The widths shrink by a factor b and the heights by a, so the wiggles get taller relative to their width: slope of the k-th wave is about (ab)k, which grows without bound. The sum is continuous (the tiny waves add up fast) but no matter how far you zoom in, new wiggles keep arriving. Historical note: Bolzano is thought to have built such an example earlier, and Weierstrass may have lectured on his in 1861, but 1872 is when it was published.

Interactive · Zoom in on a function with no slope
Waves added (a = 0.5, b = 13)
Zoom: window width

Without JavaScript: for a smooth function the slope across a shrinking window settles to one number. For W with a = 0.5 and b = 13, the average slope across ever narrower windows keeps growing in size (it multiplies by roughly 6.5 per wave) until the finite number of terms runs out.

Weierstrass's function is not a curiosity. It shows what "continuous" does and does not give you, and it prepared the way for fractals, Brownian motion paths (nowhere differentiable too) and measure theory, where Henri Lebesgue's 1902 integral handles functions Riemann's integral cannot.

What a graduate just sees

Where it shows up next

If you want to go deeper

The takeaway

Analysis puts a floor under calculus. The real line is complete, so intervals squeeze to points and continuous functions cannot skip values. A limit is a game with a guaranteed winning reply. And infinite processes (sums, limits of functions, derivatives) have conditions: without them they misbehave in specific, instructive ways.

Try this: this week, when someone says "as it gets closer and closer", ask "closer than what, and how do you know it stays that close?" That question is the epsilon.

Sources & Further Reading

Sources. The definitions, completeness, the ε–δ limit, harmonic series divergence (Oresme), Riemann's rearrangement theorem, the intermediate value theorem, uniform convergence and the term-by-term results are standard (Rudin; Abbott). Berkeley's The Analyst (1734). Dedekind and Cantor's 1872 constructions of the reals. Weierstrass 1872 (continuous nowhere differentiable function), condition ab > 1 + 3π/2, Hardy 1916 (Trans. Amer. Math. Soc. 17, 301–325), and the Bolzano precedence note: summarised from standard accounts found by search (University of Minnesota notes, Quanta Magazine, 23 January 2025). Lebesgue 1902. Textbook editions: Rudin 3rd ed. (McGraw-Hill, 1976); Abbott 2nd ed. (Springer, 2015); MIT OCW 18.100A (Fall 2020). Every number the interactives show was computed in node and python: nested rationals via exact BigInt (e.g. 1.414² = 1.999396, 1.415² = 2.002225); δ = min(1, ε/5) checked; greedy rearrangement partial sums; bisection in IEEE doubles on cos x − x (root 0.7390851332151607), x³ − x − 1 (1.324717957244746), x² − 2; 0.920 = 0.1216, 0.9920 = 0.8179.